  //   var datamodel = new DataModel();
     function GetMonthOutgo(currDate)
     {
        var newOutgo = datamodel.getMonthOutgo(currDate.getFullYear(),(currDate.getMonth() + 1));
        return newOutgo;
     }
     function GetMonthIncome(currDate)
     {
        var newIncome = datamodel.getMonthIncome(currDate.getFullYear(),(currDate.getMonth() + 1));
        return newIncome;
     }
    $("#pageindex").live('pageshow', function() {
        InitIndex();
    });
    function InitIndex(){
           
        datamodel.init();
        var today = new Date();
        $("#currmonth").html(today.getMonth() + 1);
        
       var monthIncome = GetMonthIncome(today);
       var monthOutgo = GetMonthOutgo(today);
       var monthincrease = monthIncome - monthOutgo;
       $("#monthincome").html(monthIncome);
       $("#monthoutgo").html(monthOutgo);
        $("#monthincrease").html(monthincrease);
        
        var asset = datamodel.getTotalAssets();
       var debt = datamodel.getTotalDebts();
       var realasset = asset + debt;
       $("#asset").html(asset);
       $("#debt").html(-debt);
        $("#realasset").html(realasset);
        
        $("#accountlist").html("");
        var shownum = 4;
        var index = 0;
        for(var key in datamodel.accounts)
        {
            
            if(index == shownum)
            {
                break;
            }
            var account = datamodel.accounts[key];
            var accounthtml = "<li><span>{0}</span>： ￥<span>{1}</span></li>"
            accounthtml = accounthtml.format(account.name,account.money);
             $("#accountlist").append(accounthtml);
             
             ++ index;
            
        }
        $("#accountlist").listview("refresh");
        
       
       
        
   
    }